namespace mgp.ads {
    export class QqVideoAd extends WxVideoAd {


        protected _createdAd() {
            this.loadVideoAd();
        }

        loadVideoAd() {
            this._videoAd = this._getVideoAd();
            this._isVideoLoading = true;
            this._videoAd.load().then(() => {
                debugLog('激励视频加载成功');
                this._onVideoLoaded()
            }).catch(err => {
                debugLog('激励视频加载失败');
                this._onVideoErr(err);
            })
        }

        protected _addListener() {
            if (!this._videoAd) return;
            this._videoAd.onError(this._onVideoErr.bind(this))
            // this._videoAd.onLoad(this._onVideoLoaded.bind(this))
            this._videoAd.onClose(this._onVideoClose.bind(this))
        }
        protected _removeListener() {
            if (!this._videoAd) return;
            this._videoAd.offClose(this._onVideoClose.bind(this))
            this._videoAd.offError(this._onVideoErr.bind(this))
            // this._videoAd.offLoad(this._onVideoLoaded.bind(this))
        }

    }
}